/**
 * Created with CLion.
 * Description: 
 * User: loong
 * Date: 2023/12/19
 * Time: 21:15
 */
#include <iostream>

#include "Doc.h"
using namespace Config;
using namespace std;
int main()
{
    auto doc = std::make_shared<Doc>("Menu");

    doc->AddChildren({
        make_shared<Node>("foo","true"),
        make_shared<Node>("bar","true"),
        make_shared<Node>("value","102.3E+06"),
        make_shared<Node>("popups")->AddChildren({
            make_shared<Node>("popup")->AddChildren({
                    make_shared<Node>("value","new"),
                    make_shared<Node>("onclick","CreateNewDoc()")
            }),
            make_shared<Node>("popup")->AddChildren({
                    make_shared<Node>("value","open"),
                    make_shared<Node>("onclick","OpenDoc()")
            })
        })
    });



    auto ret = doc->ToString("  ");
    cout << ret;

    auto query = doc->Query(R"(/Menu/popups/popup[3]/onclick)");

    return 0;
}